package com.weimei.conversionTreasure.fragment;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.ViewGroup;

import androidx.annotation.Nullable;
import androidx.lifecycle.ViewModelProvider;
import androidx.lifecycle.ViewModelProviders;

import com.weimei.conversionTreasure.R;
import com.weimei.conversionTreasure.app.AppViewModelFactory;
import com.weimei.conversionTreasure.databinding.LayoutFragmentTwoBinding;
import com.weimei.conversionTreasure.viewModel.TabTwoVM;

import me.goldze.mvvmhabit.base.BaseFragment;
import me.tatarka.bindingcollectionadapter2.BR;

public class TabTwoFragment extends BaseFragment<LayoutFragmentTwoBinding, TabTwoVM> {
    @Override
    public int initContentView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        return R.layout.layout_fragment_two;
    }

    @Override
    public int initVariableId() {
        return BR.viewModel;
    }

    @Override
    public TabTwoVM initViewModel() {
        return ViewModelProviders.of(this,
                (ViewModelProvider.Factory) AppViewModelFactory.getInstance(getActivity().getApplication()))
                .get(TabTwoVM.class);
    }
}
